<form action="<?php echo $this->url(array("action"=>"add")) ?>"
	method="post" id="insert-form" enctype="multipart/form-data">

	<div class="form-left">
		<label for="VLib"><?php echo video_add_title?>: <span class="required">*</span></label>
	</div>
	<div class="form-right">
		<select name="VLib">
			<option value="null"><?php echo video_add_no_select?></option>
                    <?php foreach ($this->LibVideo as $lib){?>
                    <option value="<?php echo $lib["ID"]?>"><?php echo $lib["LIB_NAME"] ?></option>
                    <?php }?>
                    </select>
	</div>
	<div class="form-left">
		<label for="VName"><?php echo video_add_name?>: <span class="required">*</span></label>
	</div>
	<div class="form-right">
		<input type="text" name="VName" class="txt" id="VName" />
		<span id="VNameError" style="color: red;"></span>
	</div>

	<div class="form-left">
		<label for="Link">Video: <span class="required">*</span></label>
	</div>
	<div class="form-right">
		<input type="text" name="Link" class="txt" id="Link" />	
		<span id="LinkError" style="color: red;"></span>
	</div>
	<div class="form-left">
		<label for="PImg"><?php echo video_add_photo?>: <span class="required">*</span></label>
	</div>
	<div class="form-right">
		<input type="file" name="VImg" class="txt" id="VImg" />
                </div>
	<div class="form-left">
		<label for="textImg"><?php echo video_add_photo_link?>: <span class="required">*</span></label>
	</div>
	<div class="form-right">
		<input type="text" name="textImg" class="txt" id="textImg" />
	</div>
	<div class="form-left">
		<label for="Stt"><?php echo video_add_status?>: <span class="required">*</span></label>
	</div>
	<div class="form-right">
		<select name="Stt" id="theme">
			<option value="1"><?php echo video_add_show?></option>
			<option value="0"><?php echo video_add_hide?></option>
		</select>
	</div>

	<div class="clear" style="text-align: right; width: 372px">
		<input type="submit" value="Save" style="float: right" />
	</div>
</form>

<script type="text/javascript">
	$("#insert-form").submit(function(){
		var flag = 1;
		if($.trim($("#VName").val()).length == 0){
			$("#VNameError").html("Tên video không được trống");
			flag = 0;
		}else{
			$("#VNameError").html("");
		}

		if($.trim($("#Link").val()).length == 0){
			$("#LinkError").html("Link Video không được rỗng");
			flag = 0;
		}else{
			$("#LinkError").html("");
		}

		if(flag == 0)
			return false;
		return true;
	});
</script>